<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2-9</title>
    <script src="vue.js"></script>
</head>
<body>
    <p>单击按钮修改文本</p>
    <div id="app">
        <p>{{msg}}</p>
        <button @click="doChange">请单击</button>
    </div>s
    <script>
         const comApp= { 
     data( ){
   return{
    msg:"初始文本！"
   }
   },
   methods:{
    doChange:function(){
        this.msg="新的文本！"
    }
   }
  };
  Vue.createApp(comApp).mount("#app");
    </script>
</body>
</html>